#ifndef CIRCLECREATEACTION_H
#define CIRCLECREATEACTION_H

#include "Common/Algebra/Vec2.h"
#include "EditorCore/IProvider.h"
#include "EditorCore/Actions/Action.h"
#include "Entities/BodyEntity.h"
#include "Entities/CircleEntity.h"

class CircleCreateAction : public editor_core::Action, public editor_core::IProvider<CircleEntity*>
{
public:
	CircleCreateAction( const cmn::Circle& circle, editor_core::IProvider<BodyEntity*>* parentBodyProvider );
	virtual ~CircleCreateAction();

	virtual inline editor_core::ActionType GetType() const { return editor_core::ActionType::Undoable; }

	virtual inline CircleEntity* GetEntity() { return m_circleEntity; }

protected:
	virtual bool Commit();
	virtual void Recommit();
	virtual void Rollback();

private:
	cmn::Circle m_circle;

	editor_core::IProvider<BodyEntity*>* m_parentBodyProvider;
	CircleEntity* m_circleEntity;
};

#endif
